$(function(){
    //传入id函数
    var pageid = 0 ;
    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串 
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    } 
    var Request = new Object();
    Request = GetRequest();
    // var 参数1, 参数2, 参数3, 参数N;
    // 参数1 = Request['参数1'];
    // 参数2 = Request['参数2'];
    // 参数3 = Request['参数3'];
    // 参数N = Request['参数N']; 
    var id = Request['id'];
    var pageid = Request['Pageid']
    //实现跳转
    $(".tiaozhuan").on("click",function(){
        console.log(111)
        location.href="./guoneizhekou.html?Pageid="+pageid+""
    })
    // var id = $(".xiangxi").data("id") ;
    console.log(id)
    $.ajax({
        url:"http://193.112.55.79:9090/api/getdiscountproduct",
        data:{
            "productid":id
        },
        dataType:"json",
        success:function(result){
            console.log(result)
            var lihtml = template("liTemplate",result);
            $(".xiangxi").html(lihtml);
        }
    })
    $(".jingdong").on("click","span",function(){
        var spantext = $(this).text();
        console.log(spantext)
        $(".huo").find("span").eq(0).text(spantext);
    })
})